package xianxin;




/**
 * Created by hasee on 2017/9/28.
 */
public class Test {
    public static void main(String[] args) {
        MyArrayList myArrayList = new MyArrayList();
        Student s1 = new Student();
        s1.setId(1);s1.setName("张三");s1.setGrade(55);
        Student s2 = new Student();
        s2.setId(2);s2.setName("李四");s2.setGrade(98);
        Student s3 = new Student();
        s3.setId(3);s3.setName("王五");s3.setGrade(80);
        Student s4 = new Student();
        s4.setId(4);s4.setName("小六");s4.setGrade(99);
        myArrayList.add(s1);
        myArrayList.add(s2);
        myArrayList.add(s3);
        myArrayList.add(s4);
        myArrayList.printAll();
        System.out.println("------------------");
        myArrayList.sortByGrade().printAll();
    }
}
